<template>
  <div class="box flex-al">
    <div class="build-active-promember-home container">
      <div class="container-title">
        <oneTitle title="设计年度人物往届公示名单"></oneTitle>
      </div>
      <div class="promember-home-box">
        <buildElTimeList @handYear="handYear"></buildElTimeList>
        <buildElTimeRight :list="tableData"></buildElTimeRight>
      </div>
    </div>
  </div>
</template>
<script>
import buildElH1 from "../build-el-h1";
import buildElTimeList from "../build-el-time-list";
import buildElTimeRight from "../build-el-time-right";
export default {
  components: {
    buildElH1,
    buildElTimeList,
    buildElTimeRight,
  },
  data() {
    return {
      tableData: [],
    };
  },
  async mounted() {
    let res = await this.api.findHistoryVoteList({
      customizeId: 1,
    });
    if (res.length != 0) {
      let res2 = await this.api.findHistoryVoteArtistList({
        voteId: res[0].id,
      });
      this.tableData = res2;
    }
  },
  methods: {
    async handYear(id) {
      let res = await this.api.findHistoryVoteArtistList({
        voteId: id,
      });
      this.tableData = res;
      console.log(res);
    },
  },
};
</script>
<style lang="less" scoped>
.box {
  width: 100%;
}
.build-active-promember-home {
  // margin-bottom: 20px;
  .promember-home-box {
    display: flex;
  }
}
</style>
